---@class BuffEffect45 : BaseBuffEffect
BuffEffect45 = ClientFight.CreateClass("BuffEffect45", ClientFight.BaseBuffEffect)
local t = BuffEffect45

---@param fight Fight
---@param buff FighterBuff
function t:action(fight, buff, ...)
    local parameters = { ... }
    local result = parameters[2];
    if (result:getDamage() > 0 ) then --//别人已经免疫过了,就不要再免疫了,因为大部分的免疫类 buff 都是触发后移除,
                                        --//所以, 如果有多个这种buff, 如果这里不阻断, 那么, 全都会触发一遍, 白白浪费了 一堆的 免疫buff
        return IBuffEffect.FAIL;
    end
    local addBuff = parameters[1];
    if (addBuff == buff) then
        return IBuffEffect.FAIL;
    end
    if (table.contains(addBuff.buffBean.f_Control,1)) then
        return IBuffEffect.FAIL;
    end
    result:setState(DamageResultTypeEnum.IMMUNITY)
    result:setDamage(result:getDamage() + 1);
    --LogUtil.info(fight, ()-> "[" + fightframe + "][EFFECT]Fighter " + buff.targetfighterId + " Buff"
    --+ buffmodelId + " 触发免疫了buff: " + addbuff.buffBean.getF_BuffId());
    return ClientFight.BaseBuffEffect.action(self,fight, buff, ...);
end

t.New()